/**
 *  @auth: sce
 *  @date: 17-12-29
 *  @desc: 计数器视图组件
 **/


import React, {Component} from 'react';
import {Button,Icon,Avatar} from 'antd';
import PropTypes from 'prop-types'

import './Counter.css'


class Counter extends Component {
    render() {
        const {count, onIncreaseClick,onSubsideClick} = this.props;
        return (
            <div className="counter">
                <Avatar style={{backgroundColor: '#00a2ae'}} size="large">{count}</Avatar><br/>
                <Button className="btn" onClick={onIncreaseClick} size="large">
                    <Icon type="plus"/>Plus
                </Button><br/>
                <Button className="btn" onClick={onSubsideClick} size="large">
                    <Icon type="minus" />Minus</Button>
            </div>
        )
    }
}

Counter.propTypes = {
    count : PropTypes.number.isRequired,
    onIncreaseClick : PropTypes.func.isRequired
};

export default Counter;